package org.shop.controller.web;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.shop.entity.ShopClassify;
import org.shop.service.ShopClassifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class WebShopClassifyController {

	private static Logger logger = LogManager.getLogger(WebShopClassifyController.class);
	
	@Autowired
    private ShopClassifyService ShopClassifyService;
	
	/**
	 * 获取所有商家类别
	 * @param req
	 * @return
	 */
	@RequestMapping("web/getShopClassifyList")
	@ResponseBody
	public List<ShopClassify> getShopClassifyList(HttpServletRequest req){
		List<ShopClassify> list = new ArrayList<ShopClassify>();
		try{
			list=ShopClassifyService.getShopClassifyList();			
		}catch(Exception e){
			logger.error(e);
		}
		return list;
	}
	
	
}
